﻿<%@ Page Language="C#" MasterPageFile="~/webAdminButtonRow.master" AutoEventWireup="true"
    CodeBehind="manageSingleRole.aspx.cs" Inherits="Salient.Web.Administration.Security.Roles.manageSingleRole" %>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="titleBar">
    <asp:Literal ID="Literal1" runat="server" Text="<%$ Resources:ManageRoleMembership %>" />
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="buttons">
    <asp:Button ValidationGroup="none" runat="server" ID="button1" Text="<%$ Resources:Back %>"
        OnClick="ReturnToPreviousPage" />
</asp:Content>
<asp:Content ID="Content3" runat="server" ContentPlaceHolderID="content">
    <%-- Cause the textbox to submit the page on enter, raising server side onclick--%>
    <input type="text" style="visibility: hidden" />
    <table width="100%">
        <tbody>
            <tr>
                <td>
                    <span class="bodyTextNoPadding">
                        <asp:Literal ID="Literal2" runat="server" Text="<%$ Resources:Instructions %>" />
                        <br />
                        <br />
                        <asp:Literal ID="Literal3" runat="server" Text="<%$ Resources:Role %>" />
                        <asp:Label ID="roleName" runat="server" Font-Bold="true">
                        </asp:Label>
                    </span>
                </td>
            </tr>
            <tr>
                <td>
                    <table>
                        <tbody>
                            <tr valign="top">
                                <td>
                                    <table cellspacing="0" cellpadding="5" class="lrbBorders" width="750" />
                                    <tbody>
                                        <tr>
                                            <td class="callOutStyle">
                                                <asp:Literal ID="Literal4" runat="server" Text="<%$ Resources:SearchForUsers %>" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="bodyTextNoPadding">
                                                <asp:Literal ID="Literal5" runat="server" Text="<%$ Resources:SearchBy %>" />
                                                <asp:DropDownList ID="dropDown1" runat="server">
                                                    <asp:ListItem runat="server" id="listItem1" Text="<%$ Resources:Username %>" />
                                                    <asp:ListItem runat="server" id="listItem2" Text="<%$ Resources:Email %>" />
                                                </asp:DropDownList>
                                                &nbsp;<asp:Literal ID="Literal6" runat="server" Text="<%$ Resources:For %>" />
                                                <asp:TextBox runat="server" ID="textBox1" Width="11em" />
                                                &nbsp;
                                                <asp:Button runat="server" ID="button2" OnClick="SearchForUsers" Text="<%$ Resources:FindUser %>" />
                                                <br />
                                                <asp:Label runat="server" ID="alphabetInfo" Text="<%$ Resources:GlobalResources,AlphabetInfo %>" /><br />
                                                <asp:Repeater runat="server" ID="repeater" OnItemCommand="RetrieveLetter">
                                                    <ItemTemplate>
                                                        <asp:LinkButton runat="server" ID="linkButton1" Text="<%#Container.DataItem%>" ForeColor="black"
                                                            CommandName="Display" CommandArgument="<%#Container.DataItem%>" />
                                                        &nbsp;
                                                    </ItemTemplate>
                                                </asp:Repeater>
                                            </td>
                                        </tr>
                                    </tbody>
                    </table>
                    <br />
                    <table id="containerTable" runat="server" border="0" cellspacing="0" cellpadding="0"
                        class="itemDetailsContainer" width="750">
                        <tbody>
                            <tr align="left" valign="top">
                                <td width="62%" height="100%" class="lrbBorders">
                                    <asp:GridView runat="server" ID="dataGrid" AllowPaging="true" border="0" CellSpacing="0"
                                        CellPadding="5" AutoGenerateColumns="False" onitemdatabound="ItemDataBound" OnPageIndexChanging="IndexChanged"
                                        PageSize="7" Width="100%" UseAccessibleHeader="true">
                                        <RowStyle CssClass="gridRowStyle" />
                                        <AlternatingRowStyle CssClass="gridAlternatingRowStyle" />
                                        <HeaderStyle CssClass="callOutStyle" Font-Bold="true" Height="10" />
                                        <SelectedRowStyle CssClass="gridSelectedRowStyle" />
                                        <PagerStyle CssClass="gridPagerStyle" />
                                        <PagerSettings Mode="Numeric" />
                                        <Columns>
                                            <asp:TemplateField runat="server" HeaderText="<%$ Resources:Username %>">
                                                <ItemTemplate>
                                                    <asp:Label runat="server" ID="userNameLink" ForeColor='black' Text='<%#DataBinder.Eval(Container.DataItem, "UserName")%>' />
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField runat="server" HeaderText="<%$ Resources:UserInRole %>">
                                                <HeaderStyle HorizontalAlign="center" />
                                                <ItemStyle HorizontalAlign="center" />
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="Checkbox1" runat="server" OnCheckedChanged="EnabledChanged" AutoPostBack="true"
                                                        Checked='<%#(bool)CallWebAdminHelperMethod(false, "IsUserInRole", new object[] {(string) DataBinder.Eval(Container.DataItem, "UserName").ToString(), (string)CurrentRole}, new Type[] {typeof(string),typeof(string)})%>' />
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                        </Columns>
                                    </asp:GridView>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <asp:Label runat="server" ID="notFoundUsers" class="bodyTextNoPadding" EnableViewState="false"
                        Visible="false" Text="<%$ Resources:NotFoundUsers %>" />
                </td>
            </tr>
        </tbody>
    </table>
    </td> </tr> </tbody> </table>
</asp:Content>
